<!DOCTYPE html>
<html>
<head>
    <!-- 声明文档使用的字符编码 -->
    <meta charset='utf-8'>
    <!-- 优先使用 IE 最新版本和 Chrome -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="renderer" content="webkit">
    <meta name="robots" content="index,follow"/>
    <meta name="viewport" content="initial-scale=1, maximum-scale=3, minimum-scale=1, user-scalable=no">
    <title>Excel导出</title>
    <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
 
</head>
<body>
<button id="exportExcel" class="btn btn-warning">导出excel</button>
<button id="exportExcel2" class="btn btn-warning">测试excel数据按钮</button>
<script type="text/javascript">
    $("#exportExcel").click(function(){
        // console.info("exportExcel");
        var url =  "http://localhost:3000/Excel";
        // console.info(url);
        window.location = url;//这里不能使用get方法跳转，否则下载不成功
 
    });
    $("#exportExcel2").click(function(){
        var url =  "http://localhost:3000/getDouBan";
        $.ajax({url:url,success:function(result){
            // $("#div1").html(result);
          console.log(result)
        }});
    });
</script>
</body>
</html>